package plugin;

/**
 * This class is an abstract representation of a plugin.  It contains the information needed
 * in order to spawn a particular plugin at a later date.
 * @author Royce
 *
 */
public class PluginDescriptor {
	private String _name;
	
	/**
	 * Constructs a PluginDescriptor
	 * @param className the class name of the plugin to add
	 */
	public PluginDescriptor(String className) {
		_name = className;
	}
	
	/**
	 * 
	 * @return the class name of the plugin this PluginDescriptor describes.
	 */
	public String getClassName() {
		return _name;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((_name == null) ? 0 : _name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PluginDescriptor other = (PluginDescriptor) obj;
		if (_name == null) {
			if (other._name != null)
				return false;
		} else if (!_name.equals(other._name))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "PluginDescriptor [_name=" + _name + "]";
	}
	
}
